JavaScript

A5.ListBoxappendRows Method

Syntax

A5.ListBox.appendRows(data)

Arguments

dataobject

Data to append to the list.

Description

Append new data to the end of the list.

Example

// To get a pointer to the A5.ListBox class see {dialog.object}.getControl
// assume lObj is a pointer to an instance of the A5.ListBox class
var data = [{name: 'Fred Smith', age: 23}];
lObj.appendRows(data); // now the list has an additional row

Example: Appending data to a List Control

The example below shows how to append data to a List Control in a UX Component. The data to append is defined as a JSON array.

var listObj = {dialog.object}.getControl('LIST1');
var _d = [
        {firstname: 'John', lastname: 'Smith'},
        {firstname: 'Fred', lastname: 'Harris'}
    ];
listObj.appendRows(_d);
The .appendRows() method does not flag the rows as "new" when added to an updatable List Control and are subsequently not synchronized to the server. If you are appending rows to an updatable List, use the addTableRow() or addTableRowsBulk() method instead.

See Also